<!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
</head>
<body>
<form id="t">
    <input name="test" value='1'/>
    <input name="test2" value='2'/>
    <input type="file" multiple='multiple' name="testFile"/>
    <button id="upload">upload</button>
</form>

<script src="/kissy/build/seed.js"></script>
<script src="/kissy/src/package.js"></script>
<script>
    var port = SERVER_CONFIG.ports[1];
    if (port != SERVER_CONFIG.ports[0]) {
        document.domain = location.hostname;
    }

    KISSY.use("io,node,json,cookie", function (S, io) {
        S.one('#upload').on('click', function (e) {
            e.halt();
            io({
                type: 'post',
                form: S.get('#t'),
                dataType: 'json', // 取 body.text
                url: 'http://' + location.hostname + ':'+port+'/kissy/src/io/tests/others/subdomain/upload.jss',
                success: function (data) {
                    alert(data);
                    alert(S.JSON.stringify(data));
                }
            });
        });
    });

</script>
</body>
</html>